package cn.gson.crm.model.dao;

import java.util.List;

import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import cn.gson.crm.model.pojo.Complain;

public interface LLJ_ComplainDao extends CrudRepository<Complain,Long>{
    
	   @Query("select new cn.gson.crm.model.pojo.Complain(c.comId,c.comDatetime,"
	   		+ "c.comDealProcess,c.comDealResult,c.comDescribe,c.comFeedback,"
	   		+ "c.comFistReceiverId,c.comFistReceiverName,c.comPeople,c.comRemarks,"
	   		+ "c.comSure,c.comTheme,c.comUrgency,c.customerId,c.customerName) from Complain c order by c.comId")   
	   public List<Complain> findByPage(Pageable p);             
	  
	   
	   @Query("select new cn.gson.crm.model.pojo.Complain(c.comId,c.comDatetime,"
	   		+ "c.comDealProcess,c.comDealResult,c.comDescribe,c.comFeedback,"
	   		+ "c.comFistReceiverId,c.comFistReceiverName,c.comPeople,c.comRemarks,"
	   		+ "c.comSure,c.comTheme,c.comUrgency,c.customerId,c.customerName) from Complain c where c.comTheme like ?1")     
	   public List<Complain> queryFindAllByTheme(String key);  
}
